Skip to content

refactor: move optional arguments of misc functions behind the ellipsis - #2778

Merged
krlmlr merged 2 commits into
mainfrom
claude/ellipsis-misc
Jul 27, 2026
Merged

refactor: move optional arguments of misc functions behind the ellipsis#2778
krlmlr merged 2 commits into
mainfrom
claude/ellipsis-misc

Conversation

@krlmlr

@krlmlr krlmlr commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Part of the repo-wide ellipsis migration coordinated in #2757
see that PR for the full rationale (CONTRIBUTING.md, Argument Order and the Ellipsis).
Based directly on main (the registry split landed via #2779); a single topic commit.

What this does

Inserts ... between the defining arguments (head) and the optional
modifiers
(tail) of 5 exported misc functions.
Arguments after ... become keyword-only.

  • Legacy positional or abbreviated calls are recovered by the generated
    ARG_HANDLE block and emit a single lifecycle::deprecate_soft("3.0.0", …)
    behavior is unchanged.
  • No defaults change, no arguments are renamed, deprecated functions untouched.
  • Registry: tools/migrations/misc.R; blocks regenerated via
    Rscript tools/generate-migrations.R (idempotent, CI-checked).
  • Rd usage/arguments updated mechanically (see note below).

New signatures

function head (positional) keyword-only tail
greedy_vertex_coloring() graph heuristic
time_bins() x middle
graph_from_graphdb() url prefix, type, nodes, pair, which, base, compressed, directed
sir() graph, beta, gamma no.sim
stochastic_matrix() graph column.wise, sparse

Notes for review

  • The environment used to prepare this PR cannot install igraph.r2cdocs
    (GitHub API unreachable), so man/*.Rd files were updated mechanically
    (usage + ... argument item) instead of via devtools::document().
    R CMD check's usage↔formals validation passes; a follow-up
    devtools::document() run may reflow whitespace but should produce no
    semantic diff.
  • Package tests that called these functions positionally were updated to
    named arguments (they are the same soft-deprecation user code will see).

@krlmlr
krlmlr force-pushed the claude/ellipsis-misc branch 2 times, most recently from 7a65dfc to ff7ed7c Compare July 26, 2026 11:09
@github-actions

Copy link
Copy Markdown
Contributor

This is how benchmark results would change (along with a 95% confidence interval in relative change) if ff7ed7c is merged into main:

  • ✔️as_adjacency_matrix: 580ms -> 579ms [-0.74%, +0.26%]
  • ✔️as_biadjacency_matrix: 561ms -> 561ms [-0.44%, +0.6%]
  • ✔️as_data_frame_both: 1.22ms -> 1.23ms [-1.34%, +2.54%]
  • ✔️as_long_data_frame: 3.23ms -> 3.25ms [-0.13%, +1.07%]
  • 🚀es_attr_filter: 2.32ms -> 2.29ms [-1.35%, -0.41%]
  • ✔️graph_from_adjacency_matrix: 96.6ms -> 97ms [-2.9%, +3.6%]
  • ✔️graph_from_data_frame: 2.75ms -> 2.75ms [-0.78%, +0.87%]
  • 🚀vs_attr_filter: 1.22ms -> 1.21ms [-1.97%, -0.15%]
  • ✔️vs_by_name: 777µs -> 789µs [-0.55%, +3.77%]
    Further explanation regarding interpretation and methodology can be found in the documentation.

@krlmlr
krlmlr marked this pull request as ready for review July 26, 2026 15:04
@krlmlr krlmlr closed this Jul 26, 2026
@krlmlr
krlmlr force-pushed the claude/ellipsis-misc branch from ff7ed7c to 0f7d122 Compare July 26, 2026 16:24
Insert `...` between the defining arguments and the optional
modifiers of 5 functions,
following the zoning rules in CONTRIBUTING.md.
Legacy positional and abbreviated calls are recovered
by the generated ARG_HANDLE blocks
(registry: tools/migrations/misc.R)
and emit a single soft deprecation for igraph 3.0.0.
No defaults change and no arguments are renamed.

Functions: graph_from_graphdb, greedy_vertex_coloring, sir, stochastic_matrix, time_bins

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016M32izVHZPfxAqemAe4BrX
@krlmlr krlmlr reopened this Jul 26, 2026
Add argument-coverage tests for the ellipsis-migrated misc functions:
greedy_vertex_coloring(), stochastic_matrix(), sir(), time_bins() and
graph_from_graphdb().
Each keyword-only tail argument is exercised by name with a real assertion,
and the legacy positional recovery path is covered with its deprecation
warning.
graph_from_graphdb() needs the network, so its named-tail test skips when the
database is unreachable and its recovery is proven offline via an invalid-prefix
validation error.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016M32izVHZPfxAqemAe4BrX
@github-actions

Copy link
Copy Markdown
Contributor

This is how benchmark results would change (along with a 95% confidence interval in relative change) if bf4c095 is merged into main:

  • ✔️as_adjacency_matrix: 946ms -> 943ms [-2.17%, +1.67%]
  • ✔️as_biadjacency_matrix: 906ms -> 903ms [-1.75%, +1.03%]
  • ✔️as_data_frame_both: 1.74ms -> 1.75ms [-1.02%, +3.16%]
  • ✔️as_long_data_frame: 4.3ms -> 4.31ms [-1.49%, +1.63%]
  • ✔️es_attr_filter: 3.11ms -> 3.19ms [-3.22%, +8.43%]
  • ✔️graph_from_adjacency_matrix: 169ms -> 168ms [-1.47%, +0.32%]
  • ✔️graph_from_data_frame: 3.76ms -> 3.69ms [-4.24%, +0.82%]
  • ✔️vs_attr_filter: 1.84ms -> 1.83ms [-2.42%, +0.78%]
  • ✔️vs_by_name: 1.2ms -> 1.23ms [-3.98%, +8.47%]
    Further explanation regarding interpretation and methodology can be found in the documentation.

@krlmlr
krlmlr merged commit 3b30b22 into main Jul 27, 2026
9 checks passed
@krlmlr
krlmlr deleted the claude/ellipsis-misc branch July 27, 2026 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants